package ganga.custodian.settings;

import ganga.custodian.CustodianApplication;
import ganga.custodian.R;

import java.util.ArrayList;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;

public class GPSParameterActivity extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.gpsparameteractivity);
		builderForSpinner();
		setCurrentTheme();
	}
	
	@Override
	protected void onResume() {
		super.onResume();
		setCurrentTheme();
	}

	private void builderForSpinner(){
		Spinner gpsSetSpinner = (Spinner)findViewById(R.id.gpsparameterspinner);
		ArrayList<String> itemForSpinner = new ArrayList<String>();
		itemForSpinner.add("Не использовать");
		itemForSpinner.add("GPS в телефоне");
		ArrayAdapter<String> adapterForSpinner = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, itemForSpinner);
		adapterForSpinner.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		gpsSetSpinner.setAdapter(adapterForSpinner);
	}
	
	private void setCurrentTheme(){
		LinearLayout thisLayout = (LinearLayout)findViewById(R.id.GPSParametersLayout);
		thisLayout.setBackgroundColor(CustodianApplication.getInstance().selectTheme.backGround);
		TextView text1 = (TextView)findViewById(R.id.gpsparametrtext1);
		text1.setTextColor(CustodianApplication.getInstance().selectTheme.firstColour);
	}
}
